package com.sinosoft.vaccinetoai.common;

import java.util.HashMap;
import java.util.Map;

/**
 * 通用常量类
 * @author xzh
 * @date 2023-04-09 16:37
 * @since 1.0.0
 */
public class CommonConstants {

    /**
     * 本地公司默认值
     */
    public static final String DEFAULT_COMPANY_CODE = "sinosoft";

    /**
     * 登录账户类型
     * 1-管理用户 2-普通用户 3-测试用户
     */
    public static final Integer AUTH_USER_TYPE_ADMIN = 1;
    public static final Integer AUTH_USER_TYPE_USER = 2;
    public static final Integer AUTH_USER_TYPE_TEST = 3;

    /**
     * 逻辑删除
     */
    public static final Integer IS_DELETE_FALSE = 0;
    public static final Integer IS_DELETE_TRUE = 1;

    /**
     * 登录账户状态
     * 1-启用 2-禁用
     */
    public static final Integer AUTH_USER_STATUS_ACTIVE = 1;
    public static final Integer AUTH_USER_STATUS_INACTIVE = 2;

    /**
     * 通用状态
     * 0-初始 1-启用 2-禁用
     */
    public static final Integer COMMON_STATUS_INIT = 0;
    public static final Integer COMMON_STATUS_ACTIVE = 1;
    public static final Integer COMMON_STATUS_INACTIVE = 2;

    /**
     * 是否
     * 1-是 0-否
     */
    public static final Integer COMMON_WHETHER_YES = 1;
    public static final Integer COMMON_WHETHER_NOT = 0;

    /**
     * 结果
     * 1-成功 0-失败
     */
    public static final Integer COMMON_RESULT_SUCCESS = 1;
    public static final Integer COMMON_RESULT_FAIL = 0;

    /**
     * 订单业务类型
     * 1-会员订单 2-套餐
     */
    public static final int ORDER_BUSINESS_TYPE_MEMBER = 1;
    public static final int ORDER_BUSINESS_TYPE_PACKAGE = 2;

    /**
     * 订单支付方式
     * 0-无 1-微信 2-支付宝 11-储值卡
     */
    public static final Integer ORDER_PAY_METHOD_NONE = 0;
    public static final Integer ORDER_PAY_METHOD_WECHAT = 1;
    public static final Integer ORDER_PAY_METHOD_ALIPAY = 2;
    public static final Integer ORDER_PAY_METHOD_STORED_CARD = 11;
    //第三方平台支付
    public static final Integer ORDER_PAY_METHOD_THIRD_PART = 22;

    /**
     * 订单状态
     * 0-待支付 1-已支付 2-已取消 3-已退款
     */
    public static final Integer ORDER_STATUS_PENDING = 0;
    public static final Integer ORDER_STATUS_PAID = 1;
    public static final Integer ORDER_STATUS_REFUNDED = 3;

    /**
     * 支付状态
     * 0-待支付 1-已支付待处理 2-已支付已处理
     */
    public static final Integer ORDER_PAY_STATUS_PENDING = 0;
    public static final Integer ORDER_PAY_STATUS_PAID_UNTREATED = 1;
    public static final Integer ORDER_PAY_STATUS_PAID_TREATED = 2;

    //插件的默认扣减常量
    public static final String ORDER_PLUG_DEDUCTION = "1";

    /**
     * 默认会员ID
     */
    public static final Long MEMBER_DEFAULT = 1L;

    /**
     * 会员购买数量单位
     * 1-年 2-月 3-日
     */
    public static final Integer MEMBER_ORDER_COUNT_UNIT_YEAR = 1;
    public static final Integer MEMBER_ORDER_COUNT_UNIT_MONTH = 2;
    public static final Integer MEMBER_ORDER_COUNT_UNIT_DAY = 3;

    public static final Map<Integer, String> MEMBER_ORDER_COUNT_UNIT_MAP = new HashMap<Integer, String>() {
        {
            put(MEMBER_ORDER_COUNT_UNIT_YEAR, "年");
            put(MEMBER_ORDER_COUNT_UNIT_MONTH, "月");
            put(MEMBER_ORDER_COUNT_UNIT_DAY, "天");
        }
    };

    /**
     * 永久截至时间
     */
    public static final String FOREVER_END_TIME = "2099-01-01";

    /**
     * 会员资格状态
     * 0-初始 1-有效 2-过期
     */
    public static final Integer MEMBERSHIP_STATUS_INIT = 0;
    public static final Integer MEMBERSHIP_STATUS_VALID = 1;
    public static final Integer MEMBERSHIP_STATUS_INVALID = 2;

    /**
     * 会员权限范围；1-通用 2-级别 3-指定会员
     */
    public static final int MEMBER_PERM_SCOPE_TYPE_COMMON = 1;
    public static final int MEMBER_PERM_SCOPE_TYPE_LEVEL = 2;
    public static final int MEMBER_PERM_SCOPE_TYPE_MEMBER = 3;

    /**
     * 套餐内容类型
     * ai_chat-知能豆 member-会员
     */
    public static final String PACKAGE_CONTENT_TYPE_BEAN = "ai_chat";
    /**
     * 检验结果插件账户
     */
    public static final  String PACKAGE_PLUG_CONTENT_TYPE_INSPECTION_RESULT = "ai_plug_inspection_result";
    /**
     * 医学影像账户
     */
    public static final  String PACKAGE_PLUG_CONTENT_TYPE_MEDICAL_IMAGE = "ai_plug_medical_image";

    /**
     * 医学指南账户
     */
    public static final  String PACKAGE_PLUG_CONTENT_TYPE_MEDICAL_GUIDELINES = "ai_plug_medicalGuidelines";

    public static final String PACKAGE_CONTENT_TYPE_MEMBER = "member";

    /**
     * 用户加减余额来源
     * 0-赠送 1-储值卡充值 2-线上套餐充值 3-插件消耗  61-对话消耗 62-检验结果 63 医学影像 64 医学指南
     */
    public static final int USER_BALANCE_SOURCE_GIVE = 0;
    public static final int USER_BALANCE_SOURCE_STORED_CARD = 1;
    public static final int USER_BALANCE_SOURCE_ONLINE_PAY = 2;
    public static final int USER_BALANCE_SOURCE_PLUG = 3;

    public static final int USER_BALANCE_SOURCE_AI_CHAT = 61;
    public static final int USER_BALANCE_SOURCE_AI_PLUGIN_INSPECTION_RESULT = 62;
    public static final int USER_BALANCE_SOURCE_AL_PLUGIN_MEDICAL_IMAGE = 63;
    public static final int USER_BALANCE_SOURCE_AL_PLUGIN_MEDICAL_GUIDELINES = 64;

    /**
     * 聊天限制
     */
    /**
     * 插件聊天回复限制
     */
    public static final int PLUG_CHAT_LIMIT = 10;

    /**
     * 缓存Key
     */
    // 手机验证码前缀
    public static final String CACHE_KEY_PREFIX_PHONE_CODE = "PHONE_CODE_";

    // 手机验证码前缀（登录使用）
    public static final String CACHE_KEY_PREFIX_PHONE_LOGIN_CODE = "PHONE_LOGIN_CODE_";

    /**
     * 正则校验规则
     */
    public static final String REGEXP_PHONE_RULE = "^1[3456789]\\d{9}$";

    /**
     * 用户生成任务状态
     */
    //生成中
    public static final Integer USER_TASK_STATUS_CREATING = 0;

    /**
     * 用户秒成文件任务状态
     */
    //生成中
    public static final Integer USER_SECONDS_STUDY_FILE_CREATING = 0;
    //生成成功
    public static final Integer USER_SECONDS_STUDY_FILE_SUCCESS = 1;
    //生成失败
    public static final Integer USER_SECONDS_STUDY_FILE_FAIL = 2;

    /**
     * 生成ID相关的独立的对象key
     */
    // 通用
    public static final String ID_GEN_KEY_COMMON = "COMMON";
    // 用户
    public static final String ID_GEN_KEY_AUTH_USER = "AUTH_USER";
    // 用户
    public static final String ID_GEN_KEY_USER = "USER";
    // 用户会员
    public static final String ID_GEN_KEY_USER_MEMBER = "USER_MEMBER";
    // 会员订单
    public static final String ID_GEN_KEY_MEMBER_ORDER = "MEMBER_ORDER";
    // 套餐订单
    public static final String ID_GEN_KEY_PACKAGE_ORDER = "PACKAGE_ORDER";
    // 订单
    public static final String ID_GEN_KEY_ORDER = "ORDER";

    //流转符号
    public static final String FLOW_NEXT_STEP_SYMBOL = "->";

    //系统初始化注册默认密码
    public static final String INIT_PASS_WORD = "czxasda4546dasq";

    //注册订单code
    public static final String REGISTER_ORDER_PACKAGR_CODE  = "PACKAGE_REGISTER_GIVE";

}
